package com.fqgj.xjd.user.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.xjd.user.dao.UserBehaviorDeviceTongdunDao;
import com.fqgj.xjd.user.entity.UserBehaviorDeviceTongdunEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * User: liuming
 * Date: 2019-07-03
 * Time: 15:19:41.443
 */
@Repository
public class UserBehaviorDeviceTongdunDaoImpl extends AbstractBaseMapper<UserBehaviorDeviceTongdunEntity> implements UserBehaviorDeviceTongdunDao {

    @Override
    public UserBehaviorDeviceTongdunEntity selectByUserCode(String userCode) {
        Map<String, String> params = new HashMap<>();
        params.put("userCode", userCode);
        return getSqlSession().selectOne(getStatement("selectTongdunDeviceByUserCode"), params);
    }

    @Override
    public void deleteByUserCode(String userCode) {
        Map<String, String> params = new HashMap<>();
        params.put("userCode", userCode);
        getSqlSession().update(getStatement("deleteTongdunDeviceByUserCode"), params);
    }
}